from tonglun_py import *
import numpy as np

export_fn("testpy", lambda x, y, z: x + y + z)
print(call_fn("testpy", 1, 2, 3))

x = np.array([1, 2, 3])
print(x.flags.f_contiguous)

import psutil
process = psutil.Process()
print('mem used:', process.memory_info().rss)

for i in range(100000):
    x = np.random.rand(1000)
    call_fn("testpy", x, x.copy(), x.copy())
    if i % 50 == 0:
        print('mem used:', process.memory_info().rss)
        pass


import gc
gc.collect()

print(1)